<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>请登陆医院管理系统</title>
<link href="images/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	//删除字符串左边的空格
	function ltrim(str) { 
		if(str.length==0)
			return(str);
		else {
			var idx=0;
			while(str.charAt(idx).search(/\s/)==0)
				idx++;
			return(str.substr(idx));
		}
	}

	//删除字符串右边的空格
	function rtrim(str) { 
		if(str.length==0)
			return(str);
		else {
			var idx=str.length-1;
			while(str.charAt(idx).search(/\s/)==0)
				idx--;
			return(str.substring(0,idx+1));
		}
	}

	//删除字符串左右两边的空格
	function trim(str) { 
		return(rtrim(ltrim(str)));
	}
	function sub(){
		var account = document.getElementById("account");
		var password = document.getElementById("pswd");
		if(trim(account.value).length == 0){
			alert("用户名不能为空。");
			username.focus();
		}else if(trim(password.value).length == 0){
			alert("密码不能为空。");
			password.focus();
		}else{
			document.forms["form"].submit();
		}
	}
	function cl(){
		document.getElementById("account").value="";
		document.getElementById("pswd").value="";
	}
</script>
</head>
<body>
	<form action="LoginServlet" method="post" name="form" id="form">
	<div id="login">
		<div id="top">
			<div id="top_left">
				<img src="images/login_03.gif" />
			</div>
			<div id="top_center"></div>
		</div>
		<div id="center">
			<div id="center_left" style="color: white;font-size:27px; font-weight: bold;text-align: right;">
				<div style="margin-top: 120px;"></div>
			</div>
			<div id="center_middle">
					<div id="user"> 
						用 户 <input type="text" name="account" id="account"/>
					</div>
					<div id="password"> 
						密 码 <input type="password" name="pswd" id="pswd"/>
					</div>
					<div align="center"><br /></div>
					<div align="center">${rs}<br /></div>
					<div id="btn">
						<a href="#" onclick="sub();">登录</a><a href="#" onclick="cl();">清空</a>
					</div>
				
			</div>
			
			<div id="center_right"></div>
		</div>
		<div id="down">
			<div id="down_left">
				<div id="inf">
					<span class="inf_text">版本信息</span> <span class="copyright">医院管理系统  重庆工商大学应用技术学院 
						2015 计算机科学与技术（软件工程）&nbsp; </span>
				</div>
			</div>
			<div id="down_center">
				&nbsp;&nbsp;&nbsp;&nbsp;
				请选择角色登陆：
				<select name="selectName" id="selectName">
 					<option value ="bing">病人患者</option>
 					<option value ="gong">工作人员</option>
				</select>
			</div>
		</div>
	</div>
	</form>
</body>
</html>
